package com.graduationdesign.zengyan.graduationdesignapp.dataLayer.profileRepository;

import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.base.Result;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.Event;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.Organization;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.PeoplesModel;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.User;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.resultModel.EventResultModel;
import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.model.resultModel.SignUpResult;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.http.Body;

/**
 * Created by ZengYan on 2018/4/14.
 *
 * @desc :
 */
public class MainLocalService implements MainService {


    @Override
    public Observable<Result<User>> login(@Body Map<String, String> loginMap) {
        return provideEmply();
    }

    @Override
    public Observable<Result<List<Organization>>> getMyOrgs(String stuNum) {
        return provideEmply();
    }

    @Override
    public Observable<Result<PeoplesModel>> getPeoplesInOrg(int id) {
        return provideEmply();
    }

    @Override
    public Observable<Result<Organization>> getOrgById(int id) {
        return null;
    }

    @Override
    public Observable<Result<User>> getProfileInfo(String stunum) {
        return provideEmply();
    }

    @Override
    public Observable<Result<List<EventResultModel>>> getEventsAll(String stunum) {
        return null;
    }

    @Override
    public Observable<Result<Event>> createEvent(Map<String, String> map) {
        return null;
    }

    @Override
    public Observable<Result<List<Event>>> getEventsFromOrg(int org_id) {
        return null;
    }


    @Override
    public Observable<Result<SignUpResult>> signUp(Map<String, String> map) {
        return null;
    }

    @Override
    public Observable<Result<List<Event>>> getEventsIJoinUp(String stuNu) {
        return null;
    }

    @Override
    public Observable<Result<List<User>>> searchUser(String stunum, String message) {
        return null;
    }

    @Override
    public Observable<Result<User>> updateUserImage(MultipartBody.Part file, String stunum, String type) {
        return null;
    }

    /**
     * @param <T>
     * @return
     */
    private <T> Observable<Result<T>> provideEmply() {
        Result<T>result = new Result();

        return Observable.just(result).map( userResult -> {
            throw new NullPointerException();
        });
    }

}
